﻿using System.Data;
using DMS.Base;

namespace DMS.Business.Utility
{
    public class StatHelper
    {
        /// <summary>
        /// 获取当月各项目费用
        /// </summary>
        /// <returns></returns>
        public static DataSet GetCurrentMonthProjectCost()
        {
            string sql = @"
select AM.ProjectName,sum(AM.Price*AM.Quantity) as Total from v_ApplyMaterials AM
inner join MA_MaterialApplyForms AF on AM.MaterApplyFormID=AF.MaterApplyFormID
inner join WF_FlowInstance FI on AF.InstanceID=FI.ID
where FI.CurrentActive='结束'
group by AM.ProjectName
";
            return DBHelper.Instance.ExecuteDataSet(CommandType.Text, sql);
        }
    }
}
